package com.industrial.im.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.industrial.common.core.utils.DateUtils;
import com.industrial.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.industrial.im.mapper.DispatchEventTypeManagementMapper;
import com.industrial.im.domain.DispatchEventTypeManagement;
import com.industrial.im.service.IDispatchEventTypeManagementService;

/**
 * 事项类型管理Service业务层处理
 *
 * @author SangGuangCan
 * @date 2024-03-08
 */
@Service
public class DispatchEventTypeManagementServiceImpl implements IDispatchEventTypeManagementService
{
    @Autowired
    private DispatchEventTypeManagementMapper dispatchEventTypeManagementMapper;

    /**
     * 查询事项类型管理
     *
     * @param baseId 事项类型管理主键
     * @return 事项类型管理
     */
    @Override
    public DispatchEventTypeManagement selectDispatchEventTypeManagementByBaseId(String baseId)
    {
        return dispatchEventTypeManagementMapper.selectDispatchEventTypeManagementByBaseId(baseId);
    }

    /**
     * 查询事项类型管理列表
     *
     * @param dispatchEventTypeManagement 事项类型管理
     * @return 事项类型管理
     */
    @Override
    public List<DispatchEventTypeManagement> selectDispatchEventTypeManagementList(DispatchEventTypeManagement dispatchEventTypeManagement)
    {
        return dispatchEventTypeManagementMapper.selectDispatchEventTypeManagementList(dispatchEventTypeManagement);
    }

    /**
     * 新增事项类型管理
     *
     * @param dispatchEventTypeManagement 事项类型管理
     * @return 结果
     */
    @Override
    public int insertDispatchEventTypeManagement(DispatchEventTypeManagement dispatchEventTypeManagement)
    {
        dispatchEventTypeManagement.setBaseId(IdUtil.simpleUUID());
        dispatchEventTypeManagement.setBaseCreateTime(DateUtils.getNowDate());
        dispatchEventTypeManagement.setBaseCreateBy(SecurityUtils.getUserId());
        dispatchEventTypeManagement.setBaseUpdateTime(DateUtils.getNowDate());
        dispatchEventTypeManagement.setBaseUpdateBy(SecurityUtils.getUserId());
        return dispatchEventTypeManagementMapper.insertDispatchEventTypeManagement(dispatchEventTypeManagement);
    }

    /**
     * 修改事项类型管理
     *
     * @param dispatchEventTypeManagement 事项类型管理
     * @return 结果
     */
    @Override
    public int updateDispatchEventTypeManagement(DispatchEventTypeManagement dispatchEventTypeManagement)
    {
        return dispatchEventTypeManagementMapper.updateDispatchEventTypeManagement(dispatchEventTypeManagement);
    }

    /**
     * 批量删除事项类型管理
     *
     * @param baseIds 需要删除的事项类型管理主键
     * @return 结果
     */
    @Override
    public int deleteDispatchEventTypeManagementByBaseIds(String[] baseIds)
    {
        return dispatchEventTypeManagementMapper.deleteDispatchEventTypeManagementByBaseIds(baseIds);
    }

    /**
     * 删除事项类型管理信息
     *
     * @param baseId 事项类型管理主键
     * @return 结果
     */
    @Override
    public int deleteDispatchEventTypeManagementByBaseId(String baseId)
    {
        return dispatchEventTypeManagementMapper.deleteDispatchEventTypeManagementByBaseId(baseId);
    }

    /**
     * @return
     */
    @Override
    public List<DispatchEventTypeManagement> queryEventType() {
        DispatchEventTypeManagement params = new DispatchEventTypeManagement();
        List<DispatchEventTypeManagement> dispatchEventTypeManagements = dispatchEventTypeManagementMapper.selectDispatchEventTypeManagementList(params);
        return dispatchEventTypeManagements;
    }
}
